<template>
  <div class="banxin jingping_sp">
    <ul>
      <li v-for="(item, index) in jingpin" :key="index">
        <div class="jingping">
          <div class="jingping_sp_t">
            <img :src="item.coverImg" alt="" />
          </div>
          <div class="jingping_sp_b">
            <p>{{ item.name }}</p>
            <span
              >{{ item.coin }}
              <img src="../assets/images/home/monad.png" alt="" />
            </span>
            <div class="btn">立即兑换</div>
          </div>
          <img
            v-show="item.isHotSale == 1"
            class="biao"
            src="../assets/images/home/hot-j.png"
            alt=""
          />
          <img
            v-show="item.isLatest == 1"
            class="biao"
            src="../assets/images/home/new-j.png"
            alt=""
          />
        </div>
      </li>
    </ul>
    <ul class="jifen" v-show="title == '积分攻略'">
      <li>
        <span>签到得鸡腿</span>
        <div>去签到</div>
        <img src="../assets/images/home/integral-01.png" alt="" />
      </li>
      <li>
        <span>购课得鸡腿</span>
        <div>去购课</div>
        <img src="../assets/images/home/integral-02.png" alt="" />
      </li>
      <li>
        <span>推荐得鸡腿</span>
        <div>去推荐</div>
        <img src="../assets/images/home/integral-03.png" alt="" />
      </li>
      <li>
        <span>去做任务得鸡腿</span>
        <div>做任务</div>
        <img src="../assets/images/home/integral-04.png" alt="" />
      </li>
    </ul>
  </div>
</template>

<script>
export default {
  data() {
    return {
      show: true,
    };
  },
  props: ["jingpin", "title"],
};
</script>
 
<style lang = "less" scoped>
@import "../assets/base.less";
.jingping_sp {
  ul {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    flex-wrap: wrap;
    box-sizing: content-box;
    li {
      margin-top: 10px;
      margin-right: 15px;
      cursor: pointer;
      &:last-of-type(4n) {
        margin-right: 0;
      }
      .jingping {
        position: relative;
        transition: all 0.3s linear;
        &:hover {
          transform: translateY(-10px);
          .btn {
            background-color: #0a328e;
            color: white;
          }
        }
        .biao {
          position: absolute;
          top: 0;
          left: 0;
        }
        .jingping_sp_t {
          img {
            width: 285px;
            height: 250px;
          }
        }
        .jingping_sp_b {
          width: 285px;
          height: 162px;
          background: #ffffff;
          display: block;
          justify-content: center;
          align-items: center;
          position: relative;
          p {
            position: absolute;
            top: 22px;
            left: 50%;
            transform: translateX(-50px);
          }
          span {
            position: absolute;
            top: 56px;
            left: 50%;
            transform: translateX(-30px);
            img {
              width: 20px;
              height: 20px;
            }
          }
          div {
            width: 100px;
            height: 36px;
            border: 1px solid #0a328e;
            position: absolute;
            bottom: 32px;
            left: 50%;
            transform: translateX(-50px);
            text-align: center;
            line-height: 36px;
            cursor: pointer;
          }
        }
      }
    }
  }
  .jifen {
    li {
      width: 285px;
      height: 168px;
      position: relative;
      overflow: hidden;
      margin-bottom: 10px;
      cursor: pointer;
      span {
        position: absolute;
        margin-top: 43px;
        left: 20px;
        font-size: 30px;
        font-weight: bold;
        color: #ffffff;
        line-height: 23px;
      }
      div {
        position: absolute;
        margin-top: 91px;
        left: 21px;
        width: 96px;
        height: 27px;
        border: 1px solid #ffffff;
        text-align: center;
        line-height: 27px;
        font-weight: bold;
        color: white;
        cursor: pointer;
      }
      img {
        transition: all 0.5s linear;
      }
    }
    li:hover {
      img {
        transform: scale(1.2);
      }
    }
  }
}
</style>